package com.lgx.common.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lgx.common.dao.IImageDao;
import com.lgx.common.entity.Image;
import com.lgx.common.exception.DataException;
import com.lgx.common.service.IImageService;

/**
 * 
 * @author acer
 *
 */
@Service("imageService")
public class ImageService implements IImageService {
	
	@Autowired
	private IImageDao imageDao;

	public IImageDao getImageDao() {
		return imageDao;
	}

	public void setImageDao(IImageDao imageDao) {
		this.imageDao = imageDao;
	}

	@Override
	public Image createImage(Image image) throws DataException {
		return this.imageDao.createImage(image);
	}

	@Override
	public Image updateImage(Image image) throws DataException {
		return this.imageDao.updateImage(image);
	}

	@Override
	public void deleteImage(Image image) throws DataException {
		this.imageDao.deleteImage(image);
	}

	@Override
	public void deleteImage(long id) throws DataException {
		this.imageDao.deleteImage(id+"");
	}

	@Override
	public Image findImageById(long id) {
		return this.imageDao.findImageById(id);
	}

}
